//
//  TittleBtn.swift
//  JKWeiBo
//
//  Created by 王冲 on 2017/6/1.
//  Copyright © 2017年 希爱欧科技有限公司. All rights reserved.
//

import UIKit

class TittleBtn: UIButton {

    // 初始化视图
    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        setTitleColor(UIColor.JKTextGayColor(), for: UIControlState.normal)
        setImage(UIImage(named:"navigationbar_arrow_down"), for: UIControlState.normal)
        setImage(UIImage(named:"navigationbar_arrow_up"), for: UIControlState.selected)
        sizeToFit()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
   
    // 调整图片和文字的位置
    override func layoutSubviews() {
        super.layoutSubviews()
      
        titleLabel?.x = 0
        imageView?.x = titleLabel!.width
    
    }
    
}
